﻿//-----------------------------------------------------------------------
// <copyright file="IPackageRepository.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings

using FastNET.CleanAct.Common.Repository.Interfaces.DataInterfaces.ManagementEngine;
using FastNET.CleanAct.Common.Repository.Interfaces.Repositories.Base;
#endregion

namespace FastNET.CleanAct.Common.Repository.Interfaces.Repositories.ManagementEngine
{
    /// <summary>
    /// Respository interface for managing IPackageData
    /// </summary>
    public interface IPackageRepository
        : IIdentityRepository<IPackageData>
    {
        /// <summary>
        /// Checks for an existing Package Name in the database
        /// </summary>
        /// <param name="name">Name to check for</param>
        /// <param name="ignoreID">Optional ID to ignore during purposes of renaming</param>
        /// <returns>Boolean indicating whether or not the name exists</returns>
        bool CheckExistingName(string name, Identity? ignoreID);

        /// <summary>
        /// Retrieves a package by the name
        /// </summary>
        /// <param name="name">Name of the package to retrieve</param>
        /// <returns>IPackageData of the item found or null if a package was not found</returns>
        IPackageData Retrieve(string name);
    }
}